package com.gms.service.repairmanager.impl;/*
@author jianghai
@data 2021 - 21:19
*/

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gms.entity.Repair.Repair;
import com.gms.mapper.RepairMapper;
import com.gms.service.repairmanager.RepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> implements RepairService {

    @Autowired
    private RepairMapper mapper;

    @Override
    public void insertRepair(Repair repair) {
        mapper.insert(repair);
    }

    @Override
    public List<Repair> ListRepair() {
        return mapper.selectList(null);
    }

    @Override
    public Repair selectById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public void updateRepair(Integer repairid) {
        Repair repair = mapper.selectById(repairid);
        repair.setTip("已维修");
        mapper.updateById(repair);
    }
}
